/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.worlds;

import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import net.worlds.ui.edge.EMain;

/**
 *
 * @author Jacob
 */
public class LoadingView extends MainView{
    private static final Color textColor = new Color(45,58,83);
    public LoadingView()
    {
        super();
    }
    @Override
    public void draw(Graphics2D g, int viewWidth, int viewHeight) {
        g.setPaint(new GradientPaint(0,0, c1, viewWidth, viewHeight, c2));
        g.fillRect(0, 0, viewWidth, viewHeight);
        if(Main.getGame() != null && Main.getGame().getCurrentWorld() != null)
        {
            String m = Main.getGame().getCurrentWorld().getMessage();
            if(m == null)
                m = "Loading...";
            g.setFont(messageFont);
            Rectangle2D rect = g.getFontMetrics().getStringBounds(m, g);
            int textX = (int) (viewWidth/ 2 - rect.getWidth() / 2);
            int textY = (int) (viewHeight / 2 + rect.getHeight() / 2);
            g.setColor(Color.white);
            g.fillRoundRect(textX-5, textY-(int)rect.getHeight(), (int)rect.getWidth()+10, (int)rect.getHeight()+10, 8, 8);
            g.setColor(textColor);
            g.drawString(m, textX, textY);
        }
    }

    @Override
    public boolean eMouseDrag(int b, int x, int y) {
        return false;
    }

    @Override
    public boolean eMouseDown(int b, int x, int y) {
        return false;
    }

    @Override
    public boolean eMouseUp(int b, int x, int y) {
        return false;
    }

    @Override
    public boolean eMouseMove(int x, int y) {
        return false;
    }

    @Override
    protected void drawGameUI(Graphics2D g, World world, int viewWidth, int viewHeight, float worldWidth, float worldHeight) {

    }

    @Override
    public EMain getOverlay() {
        return null;
    }

    @Override
    public EMain getTop() {
        return null;
    }
    
}
